"""
FIVEDASH(TM) -- General Purpose Accounting Software
Copyright (C) 2008  Obol Software Pty Ltd

This program is free software: you can redistribute it and/or modify
it. For terms and conditions, see fivedash/license/license.txt

"""

def address(validation_class):
	if validation_class == 'required':
		line2_class = ''
		indicator_color = 'red'
	else:
		line2_class = ' validate-optional-or-none'
		indicator_color = 'pink'
	html = '''						<label for="line1">Address line 1 <span class="''' + indicator_color + '''">*</span></label>
						<input name="line1" id="line1" type="text" onblur="if(!Validation.get('IsEmpty').test(this.value)&amp;&amp;this.value.toLowerCase().indexOf(' box ')&lt;0&amp;&amp;this.value.toLowerCase().indexOf(' bag ')&lt;0){elem=document.getElementById('address_type');elem.checked=true;hideUnhide(elem, 'location-fields')}" class=" ''' + validation_class + ''' validate-chars3" /><br /><br/>
						<label for="line2">line 2</label>
						<input name="line2" id="line2" type="text" class="''' + line2_class + ''' validate-chars3" /><br /><br/>
						<label for="suburb">Suburb <span class="''' + indicator_color + ''' bold">*</span></label>
						<input name="suburb" id="suburb" type="text" class=" ''' + validation_class + ''' validate-chars4" /><br /><br/>
						<label for="region">Region <span class="''' + indicator_color + ''' bold">*</span></label>
						<input name="region" id="region" type="text" class=" ''' + validation_class + ''' validate-chars4" /><br /><br/>
						<label for="code">Postal/Zip Code <span class="''' + indicator_color + ''' bold">*</span></label>
						<input name="code" id="code" type="text" class=" ''' + validation_class + ''' validate-chars6" /><br /><br/>
						<label for="country">Country <span class="''' + indicator_color + ''' bold">*</span></label>
						<input name="country" id="country" type="text" class=" ''' + validation_class + ''' validate-chars4" /><br /><br />
'''
	return html
